<?php

/*
 * 页面名称：addassign.php
 * 面向用户：老师
 * 页面介绍：本页内容对应老师功能的“添加课业”，是老师添加与修改课业的模板页。
 *
 */

//表单属性
$form_porperty=array(
    'name'=>"uploadarrange",
    'id'=>"uploadarrange"
);
//课业标题
$assignname = array(
    'name'	=> 'assignname',
    'id'	=> 'assignname',
    'class' => 'text'
);
//课业介绍
$assigninfo = array(
    'name'=>'assigninfo',
    'rows'=>'5'
);
//针对班级
foreach ($class->result() as $v) {
    $class_options[$v->id] = $v->name;
};
$size=(int)count($class_options);
$size=$size*20;
$class_porperty="multiple='multiple' style='height:$size"."'px'";
//所属课程
$course_options=array();
foreach ($course->result() as $v) {
    $course_options[$v->id] = $v->coursename;
}
//提交时间
$createtime=array(
    'name'=>'createtime',
    'class'=>'datepicker',
    'type'=>'text',
    'readonly'=>'1'
);
//停止时间
$closetime=array(
    'name'=>'closetime',
    'class'=>'datepicker',
    'type'=>'text',
    'readonly'=>'1'
);
//文件上传
$fileupload=array(
    "name"=>"assignfile",
    "id"=>"assignfile",
    'type'=>'file'
);
$submit = array(
    'name'	=> 'submit',
    'id'	=> 'submit',
    'value'	=> '提交',
    'class' => 'submit'
);

$reset = array(
    'name'	=> 'reset',
    'id'	=> 'reset',
    'value'	=> '重置',
    'class' => 'submit'
);
?>
<head>
    <?php $this->load->view('load_view'); ?>
</head>
<div class="col-wrap handin-wrap">
    <!--start col-->
    <div class="col handin">

        <div class="wrap-title">
            <p class="page-title">我的课程</p>
        </div>
        <p class="desc bg">
            页面提示：本页面显示了您目前正在教授的课程，可以通过下面的按钮来进行操作
        </p>
        <div class="itemtitle">
            <h3>操作类型</h3>
            <ul class="selectNav">
                <li><a href="<?php echo site_url('assign/editassign');?>" id="editassign"><span>修改课业</span></a></li>
                <li><a href="<?php echo site_url('assign/addassign');?>" style="_width:120px;"><span>添加/修改页面</span></a></li>
            </ul>
            <div class="clear"></div>
        </div>
        <div id="selectPage">
            <!--start arrange-wrap-->
            <div class="arrange-wrap">
                <!--start arrange-->
                <div class="arrange">
                    <?php echo form_open_multipart('assign/addassign',$form_porperty); ?>
                    <p>
                        <?php echo form_label('标题：');?>
                        <?php echo form_input($assignname)?>
                    </p>
                    <p>
                        <?php echo form_label('介绍：');?>
                        <?php echo form_textarea($assigninfo); ?>
                    </p>

                    <p>
                        <?php echo form_label('所属课程：');?>
                        <?php echo form_dropdown('courseid',$course_options); ?>
                    </p>
                    <p>
                        <?php echo form_label('针对班级：');?>
                        <?php echo form_dropdown('classid',$class_options,'',$class_porperty); ?>
                    </p>
                    <p>
                        <?php echo form_label('下发日期：');?>
                        <?php echo form_input($createtime); ?>
                    </p>
                    <p>
                        <?php echo form_label('截止日期：');?>
                        <?php echo form_input($closetime); ?>
                    </p>
                    <p>
                        <?php echo form_label('上传作业文档：');?>
                        <?php echo form_input($fileupload); ?>
                    </p>
                    <p>
                    <div class="clear"></div>
                    <?php echo form_submit($submit); ?>
                    <?php echo form_reset($reset); ?>
                    </p>
                    </form>
                </div>
                <!--end arrange-->
            </div>
            <!--end arrange-wrap-->
        </div>
    </div>
    <!--end col-->
</div>
<!--end col-wrap-->
<script>
    $('ul.selectNav li').eq(1).addClass('current');
    $(window.parent.document).find("ul.nav li a").removeClass("then");
    $(window.parent.document).find("a#mycourse").attr("class","then");
</script>